package com.auxgroup.hr.front.service.personnal.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

import com.auxgroup.hr.front.dao.domain.PsCEmpLangTbl;
import com.auxgroup.hr.front.dao.domain.PsCPersonalInfoClass;
import com.auxgroup.hr.front.dao.repository.PsCEmpLangTblRepository;
import com.auxgroup.hr.front.service.personnal.EmpLangTblService;

/** 
 * @author wangchangyun
 * @version 创建时间：180523 
 * 教育经历service
 */
@Service("empLangTblService")
public class EmpLangTblServiceImpl implements EmpLangTblService {
	private static final Logger logger = LoggerFactory.getLogger(EmpLangTblServiceImpl.class);
	
	@Autowired
	private PsCEmpLangTblRepository PsCEmpLangTblRepository;


	@Override
	public PsCEmpLangTbl getEmpLangTbl(PsCPersonalInfoClass personalInfo) {
		return PsCEmpLangTblRepository.findOne(personalInfo);
	}


	@Override
	public PsCEmpLangTbl save(PsCEmpLangTbl EmpLangTbl) {
		return PsCEmpLangTblRepository.save(EmpLangTbl);
	}


	@Override
	public Boolean delete(PsCPersonalInfoClass personalInfo) {
		try {
			PsCEmpLangTblRepository.delete(personalInfo);
		} catch (Exception e) {
			logger.error("delete EmpLangTbl error: personalInfo={}",personalInfo,e);
			return false;
		}
		return true;
	}
	
	
	@Override
	public List<PsCEmpLangTbl> getAll(String emplid) {
		PsCEmpLangTbl EmpLangTbl = new PsCEmpLangTbl();
		EmpLangTbl.setEmplid(emplid);
		return PsCEmpLangTblRepository.findAll(Example.of(EmpLangTbl));
	}


	
	
	
}
